<?php
include_once(dirname(__FILE__) . "/../../configure/configure.php");		//--> global var
include_once(dirname(__FILE__) . "/../configure/admin.config.inc.php");	//--> admin global var

include_once(dirname(__FILE__) . "/../tools/smarty/libs/Smarty.class.php");					//--> out template
include_once(dirname(__FILE__) . "/../../lib/impl/CouponImpl.php");
include_once(dirname(__FILE__) . "/../../lib/impl/MerchantImpl.php");
include_once(dirname(__FILE__) . "/../../lib/impl/CategoryImpl.php");

require_once(dirname(__FILE__) . "/../controlHeader.php");					//--> system control header
require_once(dirname(__FILE__) . "/../controlOperate.php");				//-->
require_once(dirname(__FILE__) . "/../tools/fckeditor/fckeditor.php") ;

$couponImpl	= new CouponImpl(DB_TAG_COUPON);			//--> Coupon
$merImpl 	= new MerchantImpl(DB_TAG_COUPON);			//--> Merchant
$catImpl 	= new CategoryImpl(DB_TAG_COUPON);			//--> 

$error_message 	= '';



$oCoupon 	= $couponImpl->getById($id);
$catId 		= $couponImpl->getCategoryId($id);
$oMer 		= $merImpl->getById($oCoupon->getMerchantId());

$arrInfo['category'] 	= $arrCatInfo['name'];
$arrInfo['merName'] 	= $arrMerInfo['name'];

/*----- out html -----*/
$smarty = new Smarty();	//----- out template
$smarty->template_dir = TEMPLATE_SYS_DIR;
$smarty->compile_dir  = CACHE_SYS_DIR;

$smarty->assign('error_message', $error_message);
$smarty->assign('menuGid', $menuGid);
$smarty->assign('menuid', $menuid);

$smarty->assign('backurl',$backurl);

$smarty->assign('oCoupon', $oCoupon);

$smarty->assign('merName', $oMer->getName());
$smarty->assign('catId', $catId);

$smarty->display('listCoupon_View.htm');
?>
